package org.flatshare.dao;

import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import org.flatshare.entity.User;

@Stateless
public class UserDao {

	@PersistenceContext(unitName = "flat-core")
	EntityManager em;
	
	public UserDao(){
		
	}
	public void createUser(User usr){
		
		 em.persist(usr);
	}
	public User findUser(Integer id){
		
		return em.find(User.class, id);
	}
	public void removeUser(User usr){
		em.remove(usr);
	}
	
}
